<extend name="Base/common"/>
<block name="style">
    <style>
        body {
            margin-top: 100px;
            margin-bottom: 65px;
        }

        /*头部*/
        .faretitle {
            text-align: center;
            padding: 10px 0;
            position: fixed;
            width: 100%;
            font-size: 19px;
            top: 0;
            left: 0;
            z-index: 9999;
        }

        .weui-navbar {
            margin-top: 50px;
            position: fixed;
            width: 100%;
            top: 0;
            left: 0;
        }

        .weui-navbar__item {
            padding: 8px 0;
            font-size: 16px;

        }

        /*票*/
        table {
            width: 100%;
            padding: 10px 0;
        }

        td {
            width: 50%;
        }

        .imgg { /*始/终图片*/
            height: 20px;
            float: left;
            padding-top: 3px;
            padding-left: 5px;
            padding-right: 5px;
        }

        .ff { /*起始地*/
            font-size: 16px;
        }

        .pgg { /*详细地点*/
            padding-left: 30px;
            font-size: 14px;
        }

        .pfgg { /*发车时间*/
            padding-left: 10px;
            font-size: 14px;
        }

        .button { /*订票按钮*/
            background: #1AAD19;
            padding: 3px 25px 3px 25px;
            border-radius: 5px;
            color: white;
        }

        .state {
            font-size: 15px;
            padding-left: 20px;
            color: grey;
        }

        .msgContainer {
            position: relative;
            margin-top: 18px;
            width: 100%;
        }
    </style>

</block>
<block name="body">

    <!--头部开始-->
    <div class="faretitle ts_nav">
        <div class="ts_header "><span>我的订单</span></div>
    </div>
    <!--头部结束-->

    <!--导航-->
    <div class="weui-navbar ">
        <div onclick="goToNoPay()" class="weui-navbar__item {$on1} ">
            未付款
        </div>
        <div onclick="goToOrdering()" class="weui-navbar__item {$on2}">
            预约中
        </div>
        <div onclick="goToHadPay()" class="weui-navbar__item {$on3}">
            已支付
        </div>
        <div onclick="goToCanel()" class="weui-navbar__item {$on4}">
            已取消
        </div>
        <script>
            function goToNoPay() {
                window.location.href = "{:U('getHadNoPayTicket')}";
            }

            function goToOrdering() {
                window.location.href = "{:U('getOrdingTicket')}";
            }

            function goToHadPay() {
                window.location.href = "{:U('getHadPayTicket')}";
            }

            function goToCanel() {
                window.location.href = "{:U('getHadCanelTicket')}";
            }
        </script>
    </div>
    <!--导航结束-->


    <!--信息放置框-->
    <div class="msgContainer">

        <foreach name="ticketInfo" item="v">
            <!--信息模板-->
            <div style="border: 1px solid #efefef;padding-bottom: 5px; background: white;margin-bottom: 10px;">
                <table>
                    <tbody>
                    <tr>
                        <td colspan="2" class="state">未付款</td>
                    </tr>
                    <tr>
                        <td>
                            <div><img src="{$Think.config.HOME_IMG}shi.png" alt="" class="imgg"></div>
                            <span class="ff">{$v['addrInfo']['addr_from']}</span>
                        </td>
                        <td>
                            <div><img src="{$Think.config.HOME_IMG}zhong.png" alt="" class="imgg"></div>
                            <span class="ff">{$v['addrInfo']['addr_to']}</span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <span class="pfgg">发车时间:&nbsp;&nbsp;{$v['addrInfo']['addr_depart_time']}</span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"><span style="color: red;padding-left: 10px; font-size: 14px;">&yen;{$v.od_sell_price}</span>
                            <span></span>
                            <div style="float: right;padding-right: 10px; ">
                                <a href="__MODULE__/OrderDetail/hadNoPayDetail/id/{$v.od_id}" class="button">去支付</a>
                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <!--信息模板-->
        </foreach>

    </div>

    <!--处理查询-->
    <script>
        function getHadNoPayTicket() {
            $.ajax({
                url: "{:U('Home/Api/ajaxGetHadNoPayTicket')}",
//                data: {"pics_id": pics_id},
                dataType: 'json',
                type: 'get',
                success: function (msg) {
                    console.log(msg);
                }
            });
        }
    </script>
</block>